<template>
    <div>
        这里是详情页
        <child :msg='msg' @sendMsg='receive'></child>
    </div>
</template>
<script>
import {defineComponent,onMounted,ref} from 'vue'
import child from '@/components/child/Child.vue'

export default defineComponent ({
    name:'Detail',
    components:{
        child
    },
    setup(){
        //父传子
        let msg=ref('这是父组件的数据')
        //子传父(接收子组件的数据)
        let receive=(val)=>{
            console.log(val);
        }
        return{
            msg,
            receive
        }
    }
})
</script>